package cards;

import model.Player;

public class ConditionedReceive extends Receive {
	private int povertyLimit;
	
	public ConditionedReceive(String text, int amount, int povertyLimit) {
		super(text, amount);
		this.povertyLimit = povertyLimit;
	}

	@Override
	public void execute(Player player) {
		if(player.calculatePlayerWorth() <= this.povertyLimit){
			player.deposit(this.amount);
		}
	}
}